From 75e75cd3050fd974e097ab4b7a801e59823fad85 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tadej=20Borov=C5=A1ak?= Date: Sat, 3 Jul 2010 23:16:39 +0200 Subject: [PATCH] Migrate GtkActionGroup API docs --- docs/reference/gtk/tmpl/.gitignore | 1 + docs/reference/gtk/tmpl/gtkactiongroup.sgml | 401 -------------------- docs/reference/gtk/tmpl/gtkfontsel.sgml | 5 - gtk/gtkactiongroup.c | 60 +++ gtk/gtkactiongroup.h | 51 +++ 5 files changed, 112 insertions(+), 406 deletions(-) delete mode 100644 docs/reference/gtk/tmpl/gtkactiongroup.sgml diff --git a/docs/reference/gtk/tmpl/.gitignore b/docs/reference/gtk/tmpl/.gitignore index 0c6b10c9f9..d5efd9d2f0 100644 --- a/docs/reference/gtk/tmpl/.gitignore +++ b/docs/reference/gtk/tmpl/.gitignore @@ -1,3 +1,4 @@ +gtkactiongroup.sgml gtkbbox.sgml gtkbox.sgml gtkbuilder.sgml diff --git a/docs/reference/gtk/tmpl/gtkactiongroup.sgml b/docs/reference/gtk/tmpl/gtkactiongroup.sgml deleted file mode 100644 index 27bb293dba..0000000000 --- a/docs/reference/gtk/tmpl/gtkactiongroup.sgml +++ /dev/null @@ -1,401 +0,0 @@ - -GtkActionGroup - - -A group of actions - - - -Actions are organised into groups. An action group is essentially a -map from names to #GtkAction objects. - - -All actions that would make sense to use in a particular context -should be in a single group. Multiple action groups may be used for a -particular user interface. In fact, it is expected that most nontrivial -applications will make use of multiple groups. For example, in an application -that can edit multiple documents, one group holding global actions -(e.g. quit, about, new), and one group per document holding actions that -act on that document (eg. save, cut/copy/paste, etc). Each window's menus -would be constructed from a combination of two action groups. - - -Accelerators are handled by the GTK+ accelerator map. All actions are assigned an -accelerator path (which normally has the form -<Actions>/group-name/action-name) -and a shortcut is associated with this accelerator path. All menuitems and -toolitems take on this accelerator path. The GTK+ accelerator map code makes -sure that the correct shortcut is displayed next to the menu item. - - - -GtkActionGroup as GtkBuildable - -The GtkActionGroup implementation of the GtkBuildable interface accepts -GtkAction objects as <child> elements in UI definitions. - - -Note that it is probably more common to define actions and action groups -in the code, since they are directly related to what the code can do. - - -The GtkActionGroup implementation of the GtkBuildable interface supports a -custom <accelerator> element, which has attributes named key and -modifiers and allows to specify accelerators. This is similar to the -<accelerator> element of GtkWidget, the main difference is that -it doesn't allow you to specify a signal. - - -A <structname>GtkDialog</structname> UI definition fragment. - - - - About - gtk-about - - - - - -]]> - - - - - - - - - - - - - - - - -The GtkActionGroup struct contains only private -members and should not be accessed directly. - - - - - - - - -@actiongroup: the object which received the signal. -@arg1: -@widget: - - - - - - -@actiongroup: the object which received the signal. -@arg1: -@widget: - - - - - - -@actiongroup: the object which received the signal. -@arg1: - - - - - - -@actiongroup: the object which received the signal. -@arg1: - - - - - - - - - - - - - - - - - - - - - -@name: -@Returns: - - - - - - - -@action_group: -@Returns: - - - - - - - -@action_group: -@Returns: - - - - - - - -@action_group: -@sensitive: - - - - - - - -@action_group: -@Returns: - - - - - - - -@action_group: -@visible: - - - - - - - -@action_group: -@action_name: -@Returns: - - - - - - - -@action_group: -@Returns: - - - - - - - -@action_group: -@action: - - - - - - - -@action_group: -@action: -@accelerator: - - - - - - - -@action_group: -@action: - - - - -GtkActionEntry structs are used with -gtk_action_group_add_actions() to construct actions. - - -@name: The name of the action. -@stock_id: The stock id for the action, or the name of an icon from the icon - theme. -@label: The label for the action. This field should typically be marked for - translation, see gtk_action_group_set_translation_domain(). If @label - is %NULL, the label of the stock item with id @stock_id is used. -@accelerator: The accelerator for the action, in the format understood by - gtk_accelerator_parse(). -@tooltip: The tooltip for the action. This field should typically be marked - for translation, see gtk_action_group_set_translation_domain(). -@callback: The function to call when the action is activated. - - - - - - -@action_group: -@entries: -@n_entries: -@user_data: - - - - - - - -@action_group: -@entries: -@n_entries: -@user_data: -@destroy: - - - - -GtkToggleActionEntry structs are used with -gtk_action_group_add_toggle_actions() to construct toggle actions. - - -@name: The name of the action. -@stock_id: The stock id for the action, or the name of an icon from the icon - theme. -@label: The label for the action. This field should typically be marked for - translation, see gtk_action_group_set_translation_domain(). -@accelerator: The accelerator for the action, in the format understood by - gtk_accelerator_parse(). -@tooltip: The tooltip for the action. This field should typically be marked - for translation, see gtk_action_group_set_translation_domain(). -@callback: The function to call when the action is activated. -@is_active: The initial state of the toggle action. - - - - - - -@action_group: -@entries: -@n_entries: -@user_data: - - - - - - - -@action_group: -@entries: -@n_entries: -@user_data: -@destroy: - - - - -GtkRadioActionEntry structs are used with -gtk_action_group_add_radio_actions() to construct groups of radio actions. - - -@name: The name of the action. -@stock_id: The stock id for the action, or the name of an icon from the icon - theme. -@label: The label for the action. This field should typically be marked for - translation, see gtk_action_group_set_translation_domain(). -@accelerator: The accelerator for the action, in the format understood by - gtk_accelerator_parse(). -@tooltip: The tooltip for the action. This field should typically be marked for - translation, see gtk_action_group_set_translation_domain(). -@value: The value to set on the radio action. See gtk_radio_action_get_current_value(). - - - - - - -@action_group: -@entries: -@n_entries: -@value: -@on_change: -@user_data: - - - - - - - -@action_group: -@entries: -@n_entries: -@value: -@on_change: -@user_data: -@destroy: - - - - -The function used to translate messages in e.g. #GtkIconFactory -and #GtkActionGroup. - - -@path: The id of the message. In #GtkItemFactory this will be a path - from a #GtkItemFactoryEntry, in #GtkActionGroup, it will be a label - or tooltip from a #GtkActionEntry. -@func_data: user data passed in when registering the function -@Returns: the translated message - - - - - - - -@action_group: -@func: -@data: -@notify: - - - - - - - -@action_group: -@domain: - - - - - - - -@action_group: -@string: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkfontsel.sgml b/docs/reference/gtk/tmpl/gtkfontsel.sgml index ce3ebf3005..f97de24d4e 100644 --- a/docs/reference/gtk/tmpl/gtkfontsel.sgml +++ b/docs/reference/gtk/tmpl/gtkfontsel.sgml @@ -48,11 +48,6 @@ only be accessed using the functions below. - - - - - diff --git a/gtk/gtkactiongroup.c b/gtk/gtkactiongroup.c index 658a1cad76..4ed7e38204 100644 --- a/gtk/gtkactiongroup.c +++ b/gtk/gtkactiongroup.c @@ -28,6 +28,66 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +/** + * SECTION:gtkactiongroup + * @Short_description: A group of actions + * @Title: GtkActionGroup + * + * Actions are organised into groups. An action group is essentially a + * map from names to #GtkAction objects. + * + * All actions that would make sense to use in a particular context + * should be in a single group. Multiple action groups may be used for a + * particular user interface. In fact, it is expected that most nontrivial + * applications will make use of multiple groups. For example, in an + * application that can edit multiple documents, one group holding global + * actions (e.g. quit, about, new), and one group per document holding + * actions that act on that document (eg. save, cut/copy/paste, etc). Each + * window's menus would be constructed from a combination of two action + * groups. + * + * + * Accelerators are handled by the GTK+ accelerator map. All actions are + * assigned an accelerator path (which normally has the form + * <Actions>/group-name/action-name) + * and a shortcut is associated with this accelerator path. All menuitems + * and toolitems take on this accelerator path. The GTK+ accelerator map + * code makes sure that the correct shortcut is displayed next to the menu + * item. + * + * + * GtkActionGroup as GtkBuildable + * + * The #GtkActionGroup implementation of the #GtkBuildable interface accepts + * #GtkAction objects as <child> elements in UI definitions. + * + * Note that it is probably more common to define actions and action groups + * in the code, since they are directly related to what the code can do. + * + * The GtkActionGroup implementation of the GtkBuildable interface supports + * a custom <accelerator> element, which has attributes named key and + * modifiers and allows to specify accelerators. This is similar to the + * <accelerator> element of #GtkWidget, the main difference is that + * it doesn't allow you to specify a signal. + * + * + * A #GtkDialog UI definition fragment. + * + * + * + * About + * gtk-about + * + * + * + * + * + * ]]> + * + * + */ + #include "config.h" #include diff --git a/gtk/gtkactiongroup.h b/gtk/gtkactiongroup.h index 30d7542741..9ac3e381de 100644 --- a/gtk/gtkactiongroup.h +++ b/gtk/gtkactiongroup.h @@ -77,6 +77,23 @@ struct _GtkActionGroupClass void (*_gtk_reserved4) (void); }; +/** + * GtkActionEntry: + * @name: The name of the action. + * @stock_id: The stock id for the action, or the name of an icon from the + * icon theme. + * @label: The label for the action. This field should typically be marked + * for translation, see gtk_action_group_set_translation_domain(). If + * @label is %NULL, the label of the stock item with id @stock_id is used. + * @accelerator: The accelerator for the action, in the format understood by + * gtk_accelerator_parse(). + * @tooltip: The tooltip for the action. This field should typically be + * marked for translation, see gtk_action_group_set_translation_domain(). + * @callback: The function to call when the action is activated. + * + * #GtkActionEntry structs are used with gtk_action_group_add_actions() to + * construct actions. + */ struct _GtkActionEntry { const gchar *name; @@ -87,6 +104,23 @@ struct _GtkActionEntry GCallback callback; }; +/** + * GtkToggleActionEntry: + * @name: The name of the action. + * @stock_id: The stock id for the action, or the name of an icon from the + * icon theme. + * @label: The label for the action. This field should typically be marked + * for translation, see gtk_action_group_set_translation_domain(). + * @accelerator: The accelerator for the action, in the format understood by + * gtk_accelerator_parse(). + * @tooltip: The tooltip for the action. This field should typically be + * marked for translation, see gtk_action_group_set_translation_domain(). + * @callback: The function to call when the action is activated. + * @is_active: The initial state of the toggle action. + * + * #GtkToggleActionEntry structs are used with + * gtk_action_group_add_toggle_actions() to construct toggle actions. + */ struct _GtkToggleActionEntry { const gchar *name; @@ -98,6 +132,23 @@ struct _GtkToggleActionEntry gboolean is_active; }; +/** + * GtkRadioActionEntry: + * @name: The name of the action. + * @stock_id: The stock id for the action, or the name of an icon from the + * icon theme. + * @label: The label for the action. This field should typically be marked + * for translation, see gtk_action_group_set_translation_domain(). + * @accelerator: The accelerator for the action, in the format understood by + * gtk_accelerator_parse(). + * @tooltip: The tooltip for the action. This field should typically be + * marked for translation, see gtk_action_group_set_translation_domain(). + * @value: The value to set on the radio action. See + * gtk_radio_action_get_current_value(). + * + * #GtkRadioActionEntry structs are used with + * gtk_action_group_add_radio_actions() to construct groups of radio actions. + */ struct _GtkRadioActionEntry { const gchar *name; -- 2.30.2